package net.zoneland.knowledge.enums;

import net.zoneland.knowledge.model.SanHuiYiKe;
import net.zoneland.knowledge.model.SanKeReverse;

import java.util.Objects;
import java.util.stream.Stream;

public enum SanHuiYiKeExcelSheetEnum {

    /**
     * sheet1
     */
    SHEET_ZONE(0, "三会一课巡检", SanHuiYiKe.class),

    SHEET_ONE(1, "三会一课反向巡检", SanKeReverse.class);

    public Integer getSheetIndex() {
        return sheetIndex;
    }

    public String getSheetName() {
        return sheetName;
    }

    public Class getSheetClass() {
        return sheetClass;
    }

    /**
     * sheet序号
     */
    private final Integer sheetIndex;
    /**
     * sheet名称
     */
    private final String sheetName;

    /**
     * sheet的class
     */
    private final Class sheetClass;

    SanHuiYiKeExcelSheetEnum(final Integer sheetIndex, final String sheetName, final Class sheetClass) {
        this.sheetIndex = sheetIndex;
        this.sheetName = sheetName;
        this.sheetClass = sheetClass;
    }

    public static SanHuiYiKeExcelSheetEnum getBySheetIndex(final Integer index) {
        for (SanHuiYiKeExcelSheetEnum sanHuiYiKeExcelSheetEnum : SanHuiYiKeExcelSheetEnum.values()) {
            if (Objects.equals(index, sanHuiYiKeExcelSheetEnum.sheetIndex)) {
                return sanHuiYiKeExcelSheetEnum;
            }
        }
        return null;
    }
}
